﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Data;

namespace CommunitySystemModel
{
    [Serializable]
    [DataContract]
   public class ZJZZRModel
    {
        private int _Id;
          [DataMember]
        public int Id
        {
            get { return _Id; }
            set { _Id = value; }
        }
          private string _ZCDW;
          [DataMember]
          public string ZCDW
          {
              get { return _ZCDW; }
              set { _ZCDW = value; }
          }
          private int _ZCDWID;
          [DataMember]
          public int ZCDWID
          {
              get { return _ZCDWID; }
              set { _ZCDWID = value; }
          }
          private string _ZRDW;
          [DataMember]
          public string ZRDW
          {
              get { return _ZRDW; }
              set { _ZRDW = value; }
          }
          private int _ZRDWID;
          [DataMember]
          public int ZRDWID
          {
              get { return _ZRDWID; }
              set { _ZRDWID = value; }
          }
          private string _ZRRQ;
          [DataMember]
          public string ZRRQ
          {
              get { return _ZRRQ; }
              set { _ZRRQ = value; }
          }
          private string _WH;
          [DataMember]
          public string WH
          {
              get { return _WH; }
              set { _WH = value; }
          }
          private string _CreateUser;
          [DataMember]
          public string CreateUser
          {
              get { return _CreateUser; }
              set { _CreateUser = value; }
          }
          private string _CreateDate;
          [DataMember]
          public string CreateDate
          {
              get { return _CreateDate; }
              set { _CreateDate = value; }
          }
          private string _BZ;
          [DataMember]
          public string BZ
          {
              get { return _BZ; }
              set { _BZ = value; }
          }
          private bool isselected = false;
          [DataMember]
          public bool IsSelected
          {
              get { return isselected; }
              set { isselected = value; }
          }
          private int _Sequence;
          [DataMember]
          public int Sequence
          {
              get { return _Sequence; }
              set { _Sequence = value; }
          }
          public static ZJZZRModel FillEntity(DataRow dr)
          {
              ZJZZRModel right = new ZJZZRModel();
              right.IsSelected = dr["IsSelected"].ToString() == "false" ? false : true;
              right.Sequence = Convert.ToInt32(dr["Sequence"]);
              if (dr.Table != null && dr.Table.Columns.Contains("Id")) right.Id = Convert.ToInt32(dr["Id"]);
              if (dr.Table != null && dr.Table.Columns.Contains("ZCDWID")) right.ZCDWID = Convert.ToInt32(dr["ZCDWID"]);
              if (dr.Table != null && dr.Table.Columns.Contains("ZCDW")) if (!string.IsNullOrEmpty(dr["ZCDW"].ToString())) right.ZCDW = dr["ZCDW"].ToString();
              if (dr.Table != null && dr.Table.Columns.Contains("ZRDWID")) right.ZRDWID = Convert.ToInt32(dr["ZRDWID"]);
              if (dr.Table != null && dr.Table.Columns.Contains("ZRDW")) if (!string.IsNullOrEmpty(dr["ZRDW"].ToString())) right.ZRDW = dr["ZRDW"].ToString();

              if (dr.Table != null && dr.Table.Columns.Contains("ZRRQ")) if (!string.IsNullOrEmpty(dr["ZRRQ"].ToString())) right.ZRRQ =Convert.ToDateTime(dr["ZRRQ"].ToString()).ToString("yyyy-MM-dd");
              if (dr.Table != null && dr.Table.Columns.Contains("WH")) if (!string.IsNullOrEmpty(dr["WH"].ToString())) right.WH = dr["WH"].ToString();
              if (dr.Table != null && dr.Table.Columns.Contains("CreateUser")) if (!string.IsNullOrEmpty(dr["CreateUser"].ToString())) right.CreateUser = dr["CreateUser"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("BZ")) if (!string.IsNullOrEmpty(dr["BZ"].ToString())) right.BZ = dr["BZ"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("CreateDate")) if (!string.IsNullOrEmpty(dr["CreateDate"].ToString())) right.CreateDate = dr["CreateDate"].ToString();

              return right;
          }
    }

    [Serializable]
    [DataContract]
    public class ZJZZR_Emp
    {
        private int _Id;
         [DataMember]
        public int Id
        {
            get { return _Id; }
            set { _Id = value; }
        }
         private int _ZJZZRId;
         [DataMember]
         public int ZJZZRId
         {
             get { return _ZJZZRId; }
             set { _ZJZZRId = value; }
         }
         private int _YDWID;
         [DataMember]
         public int YDWID
         {
             get { return _YDWID; }
             set { _YDWID = value; }
         }
         private string _YDW;
         [DataMember]
         public string YDW
         {
             get { return _YDW; }
             set { _YDW = value; }
         }
         private string _YKS;
         [DataMember]
         public string YKS
         {
             get { return _YKS; }
             set { _YKS = value; }
         }
         private string _YZW;
         [DataMember]
         public string YZW
         {
             get { return _YZW; }
             set { _YZW = value; }
         }
         private int _ZRDWID;
         [DataMember]
         public int ZRDWID
         {
             get { return _ZRDWID; }
             set { _ZRDWID = value; }
         }
         private string _ZRDW;
         [DataMember]
         public string ZRDW
         {
             get { return _ZRDW; }
             set { _ZRDW = value; }
         }
         private string _XKS;
         [DataMember]
         public string XKS
         {
             get { return _XKS; }
             set { _XKS = value; }
         }
         private string _XZW;
         [DataMember]
         public string XZW
         {
             get { return _XZW; }
             set { _XZW = value; }
         }
         private string _ZWCC;
         [DataMember]
         public string ZWCC
         {
             get { return _ZWCC; }
             set { _ZWCC = value; }
         }
         private string _BZ;
         [DataMember]
         public string BZ
         {
             get { return _BZ; }
             set { _BZ = value; }
         }
         private string _CreateUser;
         [DataMember]
         public string CreateUser
         {
             get { return _CreateUser; }
             set { _CreateUser = value; }
         }
         private string _CreateDate;
         [DataMember]
         public string CreateDate
         {
             get { return _CreateDate; }
             set { _CreateDate = value; }
         }
		
        private bool isselected = false;
        [DataMember]
        public bool IsSelected
        {
            get { return isselected; }
            set { isselected = value; }
        }
        private int _Sequence;
        [DataMember]
        public int Sequence
        {
            get { return _Sequence; }
            set { _Sequence = value; }
        }
        private string _XM;
        [DataMember]
        public string XM
        {
            get { return _XM; }
            set { _XM = value; }
        }
        private int _EId;
        [DataMember]
        public int EId
        {
            get { return _EId; }
            set { _EId = value; }
        }
        private string _ZWSX;
        [DataMember]
         public string ZWSX
        {
            get { return _ZWSX; }
            set { _ZWSX = value; }
        }
         private string _FGCSGZ;
        [DataMember]
         public string FGCSGZ
        {
            get { return _FGCSGZ; }
            set { _FGCSGZ = value; }
        }
         private string _BegRQ;
        [DataMember]
         public string BegRQ
        {
            get { return _BegRQ; }
            set { _BegRQ = value; }
        }
        private string _EndRQ;
        [DataMember]
             public string EndRQ
        {
            get { return _EndRQ; }
            set { _EndRQ = value; }
        }
        private string _TLSJ;
        [DataMember]
         public string TLSJ
        {
            get { return _TLSJ; }
            set { _TLSJ = value; }
        } 
            
        public static ZJZZR_Emp FillEntity(DataRow dr)
        {
            ZJZZR_Emp right = new ZJZZR_Emp();
            right.IsSelected = dr["IsSelected"].ToString() == "false" ? false : true;
            right.Sequence = Convert.ToInt32(dr["Sequence"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Id")) right.Id = Convert.ToInt32(dr["Id"]);
            if (dr.Table != null && dr.Table.Columns.Contains("ZJZZRId")) right.ZJZZRId = Convert.ToInt32(dr["ZJZZRId"]);
            if (dr.Table != null && dr.Table.Columns.Contains("EId")) right.EId = Convert.ToInt32(dr["EId"]);
            if (dr.Table != null && dr.Table.Columns.Contains("XM")) if (!string.IsNullOrEmpty(dr["XM"].ToString())) right.XM = dr["XM"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("YDWID")) right.YDWID = Convert.ToInt32(dr["YDWID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("YDW")) if (!string.IsNullOrEmpty(dr["YDW"].ToString())) right.YDW = dr["YDW"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZRDWID")) right.ZRDWID = Convert.ToInt32(dr["ZRDWID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("ZRDW")) if (!string.IsNullOrEmpty(dr["ZRDW"].ToString())) right.ZRDW = dr["ZRDW"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("YDW")) if (!string.IsNullOrEmpty(dr["YDW"].ToString())) right.YDW = dr["YDW"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("YKS")) if (!string.IsNullOrEmpty(dr["YKS"].ToString())) right.YKS = dr["YKS"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("YZW")) if (!string.IsNullOrEmpty(dr["YZW"].ToString())) right.YZW = dr["YZW"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("XKS")) if (!string.IsNullOrEmpty(dr["XKS"].ToString())) right.XKS = dr["XKS"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("XZW")) if (!string.IsNullOrEmpty(dr["XZW"].ToString())) right.XZW = dr["XZW"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZWCC")) if (!string.IsNullOrEmpty(dr["ZWCC"].ToString())) right.ZWCC = dr["ZWCC"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZWSX")) if (!string.IsNullOrEmpty(dr["ZWSX"].ToString())) right.ZWSX = dr["ZWSX"].ToString();
          
            if (dr.Table != null && dr.Table.Columns.Contains("CreateUser")) if (!string.IsNullOrEmpty(dr["CreateUser"].ToString())) right.CreateUser = dr["CreateUser"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("BZ")) if (!string.IsNullOrEmpty(dr["BZ"].ToString())) right.BZ = dr["BZ"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("CreateDate")) if (!string.IsNullOrEmpty(dr["CreateDate"].ToString())) right.CreateDate = dr["CreateDate"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("FGCSGZ")) if (!string.IsNullOrEmpty(dr["FGCSGZ"].ToString())) right.FGCSGZ = dr["FGCSGZ"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("BegRQ")) if (!string.IsNullOrEmpty(dr["BegRQ"].ToString())) right.BegRQ = dr["BegRQ"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("EndRQ")) if (!string.IsNullOrEmpty(dr["EndRQ"].ToString())) right.EndRQ = dr["EndRQ"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("TLSJ")) if (!string.IsNullOrEmpty(dr["TLSJ"].ToString())) right.TLSJ = dr["TLSJ"].ToString();

            return right;
        }
    }
}
